package com.skyworth.web.common;

import org.springframework.context.annotation.Scope;

import javax.annotation.ManagedBean;
import java.util.Date;
import java.util.HashMap;

/**
 * @author holin
 * @date 1/8/16.
 */

@ManagedBean
@Scope("prototype")
public class ApiResponse {
    private Boolean success;
    private String message;
    private Object data;
    private Date timestamp;

    public ApiResponse() {
        this.success = false;
        this.message = "Message Here";
        this.data = new HashMap<>();
        this.timestamp = new Date();
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
